﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CourseUtils;

namespace LuckyTicket
{

    class Program
    {
        static void Main(string[] args)
        {           
            int Number1 = IOHelpers.ReadIntFromConsole("Enter first number:");
            int Number2 = IOHelpers.ReadIntFromConsole("Enter second number");
            int Number3 = IOHelpers.ReadIntFromConsole("Enter third number");

            int BiggestNumber = KnowBiggestNumber(Number1, Number2, Number3);

            Console.WriteLine("Biggest number is " + BiggestNumber);
            Console.WriteLine("Press any button to continue...");
            Console.ReadLine();

            int Number4 = IOHelpers.ReadIntFromConsole("Enter fourth number:");
            int Number5 = IOHelpers.ReadIntFromConsole("Enter fifth number:");
            int Number6 = IOHelpers.ReadIntFromConsole("Enter sixth number:");

            int BiggestNumber2 = KnowBiggestNumber(Number4, Number5, Number6);

            Console.WriteLine("Biggest number is " + BiggestNumber2);
            Console.WriteLine("Press any button to know the result about lucky ticket!");
            Console.ReadLine();

            if (Number1 + Number2 + Number3 == Number4 + Number5 + Number6)
                Console.WriteLine("Congratulation! You got a lucky tiket!");
            else
            {
                Console.WriteLine("Try again...");
                Main(null);
            }

            Console.ReadLine();
                     
        }

        static int KnowBiggestNumber(int FirstNum, int SecondNum, int ThirdNum)
        {
            if (FirstNum > SecondNum && FirstNum > ThirdNum)
                return FirstNum;
            else if (SecondNum > FirstNum && SecondNum > ThirdNum)
                return SecondNum;
            else return ThirdNum;
        }

        public static string[] Null { get; set; }
    }
}